﻿$.replace = function (source, pattern, value) {
    if (source) {
        var reg = new RegExp("\\"+pattern, 'gm');
        return source.replace(reg, value);
    }
    return source;
}